@Component("UnicoreBeyondUi.Dispatch.SaveTaskDefinitionActionHandler")
public class SaveTaskDefinitionActionHandler
    implements ActionHandler<SaveTaskDefinitionAction,
        SaveTaskDefinitionResult> {

  @Autowired
  private TaskService taskService;

  @Override
  public SaveTaskDefinitionResult execute(
      SaveTaskDefinitionAction action)
      throws ActionException {
    try {
      taskService.saveTaskDefinition(action.getTaskDefinition());
      return new SaveTaskDefinitionResult();
    }
    catch (BusinessException e) {
      throw new ActionException(e);
    }
  }

  @Override
  public Class<SaveTaskDefinitionAction> getActionType() {
    return SaveTaskDefinitionAction.class;
  }

  @Override
  public void rollback(SaveTaskDefinitionAction action,
      SaveTaskDefinitionResult result)
      throws ActionException {}
}
